package mtt.us.hmvcFramework.client.hmvc.view;

import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.Widget;

import hmvc4gwt.client.event.HmvcEventListener;
import hmvc4gwt.client.view.View;

public abstract class GuiView extends View  implements HmvcEventListener {
	
	private final Panel mainPanel = new AbsolutePanel();
	
	public final void doInit() {
		
		mainPanel.setStyleName("mainPanel");
		
		doInitImpl();
	}

	public final Widget getWidget() {
		return mainPanel;
	}
	
	
	public abstract void doInitImpl();

	public final void add(Widget child) {
		mainPanel.add(child);
	}

	public final void clear() {
		mainPanel.clear();
	}
	
	public boolean remove(Widget child) {
		return mainPanel.remove(child);
	}
}
